class Solution {
    public void duplicateZeros(int[] arr) {
        int len=arr.length;
        for(int i=0;i<len-1;i++){
            if(arr[i]==0){
                int j=len-1;
                while(j>i){
                    arr[j]=arr[j-1];
                    j--;
                }
                i++;
            }
        }
    }
}








class Solution {
    public int numEquivDominoPairs(int[][] dominoes) {
        int[] arr=new int[100];
        int count=0;
        for(int[] num : dominoes){
            if(num[0]>num[1]){
                int tmp=num[0];
                num[0]=num[1];
                num[1]=tmp;
            }
            int sum=num[0]+num[1]*10;
            count+=arr[sum];
            arr[sum]++;
        }
        return count;
    }
}












class Solution {
    public int tribonacci(int n) {
        if(n==0){
            return 0;
        }
        if(n<=2){
            return 1;
        }
        int sum=0;
        int q=1;
        int p=1;
        int x=0;
        for(int i=3;i<=n;i++){
            sum=q+p+x;
            x=q;
            q=p;
            p=sum;
        }
        return sum;
    }
}










class Solution {
    public int largestSumAfterKNegations(int[] nums, int k) {
        int len=nums.length;
        Arrays.sort(nums);
        for(int i=0;i<len;i++){
            if(nums[i]<0&&k>0){
                k--;
                nums[i]=-nums[i];
            }
        }
        Arrays.sort(nums);
        if((k&1)==1){
            nums[0]*=-1;
        }
        int sum=0;
        for(int num : nums){
            sum+=num;
        }
        return sum;
    }
}









class Solution {
    public int lastStoneWeight(int[] stones) {
        int index=stones.length-1;
        for(int i=0;i<stones.length-1;i++){
            Arrays.sort(stones);
            if(stones[index-1]==0){
                break;
            }
            stones[index]-=stones[index-1];
            stones[index-1]=0;
        }
        return stones[index];
    }
}










class Solution {
    public int findJudge(int n, int[][] trust) {
        int[] arr=new int[n+1];
        for(int[] trus : trust){
            arr[trus[1]]++;
            arr[trus[0]]--;
        }
        int index=-1;
        for(int i=1;i<=n;i++){
            if(arr[i]==n-1){
                index=i;
                break;
            }
        }
        return index;
    }
}













class B {
    public int Func() {
        System.out.print("B");
        return 0;
    }
}
class D extends B {
    @Override
    public int Func() {
        System.out.print("D");
        return 0;
    }
}
public class prog {
    public static void main(String[] args) {
        B a = new B();
        B b = new D();
        a.Func();
        b.Func();
    }
}